package com.yunpuvip.sachet.modular.util.sms;

/**
 * 短信模板类型
 *
 * @author hyf
 * @date 2018-09-18
 **/
public enum SMSTemplateType {
    /**
     *
     */
    REGISTER(1, "注册"),
    RECHARGE(2, "充值成功"),
    UPDATE(3, "修改余额"),
    COMSUME(4, "消费");

    Integer code;
    String message;

    SMSTemplateType(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public static String valueOf(Integer status) {
        if (status == null) {
            return "";
        } else {
            for (SMSTemplateType s : SMSTemplateType.values()) {
                if (s.getCode().equals(status)) {
                    return s.getMessage();
                }
            }
            return "";
        }
    }
}